home *** CD-ROM | disk | FTP | other *** search
-
- HFMN
- A very fast packing & fast unpacking dynamic huffman
- Version 1.16
- Copyright 1993 Martin Hauner
-
-
-
- License/Disclaimer
- ------------------
-
- This library may be freely distributed with the XPK compression package, as long
- as it is kept in its original, complete, and unmodified form. It may not be
- distributed by itself or in a commercial package of any kind without my
- permission.
-
- This program is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE.
-
-
- Description
- -----------
-
- This XPK sub-library basically uses the same algorithm (dynamic huffman) as
- found in the xpkHUFF.library. For more detailed information about the huffman
- algorithm, take a look into HUFF.doc from M.Zimmermann -- and skip the part that
- huffman compression & decompression is pretty slow !. In difference to HUFF,
- HFMN is FAST on compression and decompression and produces a slightly better
- output. Although the basic algorithm is the same, it is entirely different
- implemented, therefore HFMN will not depack HUFF and HUFF not HFMN !
-
-
-
- Actually HFMN is, with 68000 code and Amiga 4000/40, ..... than HUFF.
-
- · ~2.3 times faster on ascii file compression
- · ~3.5 times faster on executeable file compression
- · ~1.5 times faster on decompression
- · ~350 byte shorter per 65535 Byte (MaxPkInChunk)
-
- HFMN needs for private buffers (no xpkmaster.library buffers)
-
- · 7.5 Kbyte packing memory
- · 6 KByte unpacking memory
-
-
-
- Following is a table briefly listing some comparative statistics for HFMN and
- HUFF. These were generated by xBench on the standard XPK benchmark system
- (A3000/25 with SCRAM, using the AmigaVision executeable as data) and on
- A4000/40. Note that memory needs don't include xpkmaster.library's buffers.
-
-
- Method Packing Unpacking Packing Unpacking Compression
- Memory Memory Speed Speed Ratio
- ------ ------- --------- ------- --------- -----------
- HFMN 7.5 K 6 K 224 K/s 194 K/s 24.7
-
- HUFF 30 K 71 K ? 88 K/s 138 K/s 24.1
-
-
- and now the same with A4000/40
-
-
- Method Packing Unpacking Packing Unpacking Compression
- Memory Memory Speed Speed Ratio
- ------ ------- --------- ------- --------- -----------
- HFMN 7.5K 6K 405 K/s 422 K/s 24.7
-
- HUFF 30K 71K ? 130 K/s 260 K/s 24.1
-
-
-
- For what reasons is HFMN so different from HUFF ?
-
- · First, i use heapsort to create the huffman tree, which is most responsible
- for packing speed.
- (heapsort is the second-best sort algorithm and is based upon binary trees)
-
- · Second, i generate an (almost) optimal unpack code from the huffman tree. So
- best possible unpacking speed is (nearly) reached.
-
- · Third, i save the huffman tree recursivly. Therefore i need max. 320 byte
- to save the huffman tree and output size is slightly improved against HUFF.
-
-
-
- Thanks
- ------
-
- to Karsten Dageförde
-
- for
- · his help on my first packer
- · telling me some bit tricks, especially about using the x-flag
- · producing ideas to improve HFMN (save tree recursivly, generate unpack code)
-
- to Bilbo the first
- for
-
- · providing A3000 xBench ratings
-
-
-
- Version History
- ---------------
-
- V 1.16 - first public version.
-
-
- Contact Address
- ---------------
-
- Martin Hauner
- sorry, no email
-